<!--
 * @Date: 2020-08-13 11:37:30
 * @LastEditors: leehave
 * @LastEditTime: 2020-08-26 09:13:10
-->
<template>
  <div class="canvas-qcode">
    <p class="notice">温馨提示：您还未关注公众号，请先关注！</p>
    <img :src="url" class="qrcode" alt="" srcset="">
    <p class="bottom-tip">长按识别二维码</p>
  </div>
</template>

<script>
import QRCode from 'qrcode';
export default {
  data() {
    return {
      value: this.$route.query.qrCode,
      size: 150,
      url: ''
    };
  },
  computed: {},
  created() {
    console.log(this.$route.query)
    this.genQrcode()
  },
  mounted() {},
  watch: {},
  methods: {
    genQrcode(){
      QRCode.toDataURL(this.$route.query.qrCode)
      .then(url => {
        this.url = url
      })
      .catch(err => {
        console.error(err)
      })
    }
  },
  components: {
    
  },
};
</script>

<style lang="less">
.canvas-qcode{
  text-align: center;
  .notice,.bottom-tip{
    font-size: 16px;
    padding: 20px 0;
  }
  .qrcode{
    width: 150px;
    height: 150px;
  }
}
</style>
